import Vue from "vue";
import VueRouter from "vue-router";

// import Home from "./views/Home.vue";
// import About from "./views/About.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/home",
      // component: Home,
      components: {
        // key: value
        //    key - RouterView 的 名字
        //    value - 组件
        left: () => import(/* webpackChunkName: "home" */ "./views/Home.vue"),
        right: () =>
          import(/* webpackChunkName: "about" */ "./views/About.vue"),
      },
    },
    {
      path: "/about",
      component: () =>
        import(/* webpackChunkName: "about" */ "./views/About.vue"),
    },
  ],
});

export default router;
